package com.mask.im.business.controller.friend;

import com.mask.im.business.annotation.AesCrypto;
import com.mask.im.business.common.model.RestResponse;
import com.mask.im.business.model.dto.IMFriendApplicationDTO;
import com.mask.im.business.model.vo.IMFriendVO;
import com.mask.im.business.service.IMFriendRelationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * 好友表
 *
 * @author jian
 */
@Api(tags = "好友关系接口")
@RestController
@RequestMapping("friend")
public class IMFriendRelationController {

    @Resource
    private IMFriendRelationService friendRelationService;

    @ApiOperation("获取好友列表")
    @GetMapping("list")
    public RestResponse<List<IMFriendVO>> getFriendList() {
        return friendRelationService.getFriendList();
    }


    @AesCrypto
    @ApiOperation("添加好友操作")
    @PostMapping("add")
    public RestResponse<?> addFriend(@RequestBody IMFriendApplicationDTO friendApplicationDTO) {
        return friendRelationService.addFriendApplication(friendApplicationDTO);
    }

    @ApiOperation("删除好友操作")
    @PostMapping("delete")
    public RestResponse<Void> deleteFriend(@RequestBody IMFriendApplicationDTO friendApplicationDTO) {
        return null;
    }

    @ApiOperation("拉黑好友操作")
    @PostMapping("block")
    public RestResponse<Void> blockFriend(@RequestBody IMFriendApplicationDTO friendApplicationDTO) {
        return null;
    }

    @ApiOperation("同意好友申请")
    @PostMapping("agree")
    public RestResponse<Void> agreeFriendApplication(@RequestBody IMFriendApplicationDTO friendApplicationDTO) {
        return null;
    }

    @ApiOperation("拒绝好友申请")
    @PostMapping("refuse")
    public RestResponse<Void> refuseFriendApplication(@RequestBody IMFriendApplicationDTO friendApplicationDTO) {
        return null;
    }


}
